package com.hk.commons.enm;

/**
 * Created by anti
 * @author Antinomy
 */
public enum YingmiBankType {

    bank002("bank:002","工商银行"),
    bank003("bank:003","农业银行"),
    bank004("bank:004","中国银行"),
    bank005("bank:005","建设银行"),
    bank006("bank:006","交通银行"),
    bank007("bank:007","招商银行"),
    bank008("bank:008","广发银行"),
    bank009("bank:009","中信银行"),
    bank010("bank:010","浦发银行"),
    bank011("bank:011","深圳发展"),
    bank012("bank:012","兴业银行"),
    bank013("bank:013","光大银行"),
    bank014("bank:014","民生银行"),
    bank015("bank:015","北京银行"),
    bank016("bank:016","上海银行"),
    bank017("bank:017","平安银行"),
    bank018("bank:018","邮储银行"),
    bank019("bank:019","华夏银行"),
    bank021("bank:021","宁波银行"),
    bank022("bank:022","上海农商行"),
    bank024("bank:024","青岛银行"),
    bank025("bank:025","徽商银行"),
    bank028("bank:028","杭州银行"),
    bank033("bank:033","江苏银行"),
    bank034("bank:034","渤海银行"),
    bank040("bank:040","齐商银行"),
    bank064("bank:064","广州农商行"),
    bank901("bank:901","北京农商行"),
    NONE("NA", "未支持银行");

    protected String paymentType;
    protected String value;

    YingmiBankType(String paymentType, String value) {
        this.value = value;
        this.paymentType = paymentType;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String code) {
        this.paymentType = code;
    }

    public static YingmiBankType getBankType(String paymentType) {
        for (YingmiBankType type : YingmiBankType.values()) {
            if (type.getPaymentType().equals(paymentType)) {
                return type;
            }
        }
        return NONE;
    }
}